<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <form class="form-horizontal" style="width: 400px; margin: 100px auto" action="/loginsubmit" method="post">
        <div class="form-group">
            <label for="username" class="col-sm-2 control-label">账号</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="username" id="username" placeholder="账号">
            </div>
        </div>
        <div class="form-group">
            <label for="password" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" name="password" id="password" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="checkbox"> 记住密码
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default" id="loginBtn">登录</button>
                <button type="button" class="btn btn-default" id="registerBtn">注册</button>
            </div>
        </div>
    </form>
    <p>${error}</p>
</div>

<script src="../js/jquery-3.2.1.js"></script>

<!--<script>-->
    <!--$("#loginBtn").click(function () {-->

        <!--$.ajax({-->
            <!--url: "/user/login",-->
            <!--type: "post",-->
            <!--data: {-->
                <!--name: $("#name").val(),-->
                <!--password: $("#password").val()-->
            <!--},-->
            <!--success: function (result) {-->
                <!--if (result) {-->
                    <!--window.location.href = "/user/blog";-->
                <!--} else {-->
                    <!--alert("账号或密码不正确")-->
                <!--}-->
            <!--}-->
        <!--})-->
    <!--});-->

    <!--$("#registerBtn").click(function () {-->
        <!--window.location.href = "/register";-->
    <!--});-->

<!--</script>-->

</body>
</html>